Part Number Hot Search : 
4LS245 C4517 07K40 TS612 221M25 RC142 CPC1001N RC142
Product Description
Full Text Search
 

To Download ELM3271 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 ELM327 OBD to RS232 Interpreter
Description
Almost all new automobiles produced today are required, by law, to provide an interface from which test equipment can obtain diagnostic information. The data transfer on these interfaces follow several standards, none of which are directly compatible with PCs or PDAs. The ELM327 is designed to act as a bridge between these On-Board Diagnostics (OBD) ports and standard RS232 ports. The ELM327 builds on improved versions of our proven ELM320, ELM322, and ELM323 interfaces by adding seven CAN protocols to them. The result is an IC that can automatically sense and convert the most common protocols in use today. There are a number of other improvements as well - a high speed RS232 option, battery voltage monitoring, and customizable features through programmable parameters, to name only a few. The ELM327 requires few external components to make a fully functioning circuit. The following pages discuss the interface details, and show how to use the IC to `talk' to your vehicle, then concludes with two schematics to get you started.
Features
* Supports 12 protocols * Automatically searches for a protocol * Fully configurable with AT commands * RS232 baud rates to 500Kbps * Voltage input for battery monitoring * Low power CMOS design
Connection Diagram PDIP and SOIC
(top view)
MCLR Vmeasure J1850 Volts J1850 Bus+ Memory Baud Rate LFmode VSS XT1 OBD Tx LED OBD Rx LED RS232 Tx LED RS232 Rx LED CAN Rx CAN Tx ISO L ISO K VDD VSS RS232 Rx RS232 Tx Busy RTS
Applications
* Diagnostic trouble code readers * Automotive scan tools * Teaching aids
XT2 VPW In ISO In PWM In J1850 Bus-
4.00 MHz
Block Diagram
Memory
5
XT1
9
10
XT2
MCLR
1
Vmeasure
2
Baud Rate LFmode RS232Rx RS232Tx RTS Busy
18 17
6 7
RS232 Interface
Command and Protocol Interpreter
A/D Converter
CAN ISO 15765-4 SAE J1939*
ISO 9141-2 ISO 14230-4
SAE J1850 PWM & VPW
15 16 25
...28
23
24
21
22
12
3
4
14
13
11
status LEDs
OBD interfaces
*some support
ELM327DSC
Elm Electronics - Circuits for the Hobbyist www.elmelectronics.com
1 of 51
ELM327
Pin Descriptions
MCLR (pin 1) A momentary logic low applied to this input will reset the IC. If unused, this pin should be connected to a logic high (VDD) level. Vmeasure (pin 2) This analog input is used to measure a 0 to 5V signal that is applied to it. Care must be taken to prevent the voltage from going outside of the supply levels of the ELM327, or damage may occur. If it is not used, this pin should be tied to either VDD or VSS. J1850 Volts (pin 3) This output can be used to control a voltage supply for the J1850 Bus+ output. The pin will output a logic high level when a nominal 8V is required (for J1850 VPW), and will output a low level when 5V is needed (as for J1850 PWM applications). If this switching capability is not required for your application, this output can be left open-circuited. J1850 Bus+ (pin 4) This active high output is used to drive the J1850 Bus+ Line to an active level. Note that this signal does not have to be used for the Bus- Line (as was the case for the ELM320), since a separate J1850 Bus- drive output is provided on pin 14. Memory (pin 5) This input controls the default state of the memory option. If this pin is at a high level during power-up or reset, the memory function will be enabled by default. If it is at a low level, then the default will be to have it disabled. Memory can always be enabled or disabled with the AT M1 and AT M0 commands. Baud Rate (pin 6) This input controls the baud rate of the RS232 interface. If it is at a high level during power-up or reset, the baud rate will be set to 38400 (or the rate that has been set by PP 0C). If at a low level, the baud rate will be 9600. LFmode (pin 7) This input is used to select the default linefeed mode to be used after a power-up or system reset. If it is at a high level, then by default messages sent by the ELM327 will be terminated with both a carriage return and a linefeed character. If it is at a low level, lines will be terminated by a carriage return only. This behaviour can always be modified by issuing an AT L1 or AT L0 command (see the section on AT Commands). VSS (pins 8 and 19) Circuit common must be connected to these pins. XT1 (pin 9) and XT2 (pin 10) A 4.000 MHz oscillator crystal is connected between these two pins. Loading capacitors as required by the crystal (typically 27pF each) will also need to be connected between each of these pins and circuit common (Vss). Note that this device has not been configured for operation with an external oscillator - it expects a crystal to be connected to these pins. Use of an external clock source is not recommended. VPW In (pin 11) This is the active high input for the J1850 VPW data signal. When at rest (bus recessive) this pin should be at a low logic level. This input has Schmitt trigger waveshaping, so no special amplification is required.
All rights reserved. Copyright 2005, 2006, and 2007 by Elm Electronics Inc. Every effort is made to verify the accuracy of information provided in this document, but no representation or warranty can be given and no liability assumed by Elm Electronics with respect to the accuracy and/or use of any products or information described in this document. Elm Electronics will not be responsible for any patent infringements arising from the use of these products or information, and does not authorize or warrant the use of any Elm Electronics product in life support devices and/or systems. Elm Electronics reserves the right to make changes to the device(s) described in this document in order to improve reliability, function, or design.
ELM327DSC
Elm Electronics - Circuits for the Hobbyist www.elmelectronics.com
2 of 51
ELM327
Pin Descriptions (continued)
ISO In (pin 12) This is the active low input for the ISO 9141 and ISO 14230 data signal. It is derived from the K Line, and should be at a high logic level when at rest (bus recessive). No special amplification is required, as this input has Schmitt trigger waveshaping. PWM In (pin 13) This is the active low input for the J1850 PWM data signal. It should normally be at a high level when at rest (ie. bus recessive). This input has Schmitt trigger waveshaping, so no special amplification is required. J1850 Bus- (pin 14) This active high output is used to drive the J1850 Bus- Line to an active (dominant) level for J1850 PWM applications. If unused, this output can be left open-circuited. RTS (pin 15) This active low "Request To Send" input can be used to interrupt the OBD processing in order to send a new command. Normally high, the line is brought low for attention, and should remain so until the Busy line (pin 16) indicates that the ELM327 is no longer busy. This input has Schmitt trigger waveshaping. Busy (pin 16) This active high output shows the current state of the ELM327. If it is at a low level, the processor is ready to receive ASCII commands and characters, but if it is at a high level, commands are being processed. RS232Tx (pin 17) This is the RS232 data transmit output. The signal level is compatible with most interface ICs (output is normally high), and there is sufficient current drive to allow interfacing using only a PNP transistor, if desired. RS232Rx (pin 18) This is the RS232 receive data input. The signal level is compatible with most interface ICs (when at idle, the level is normally high), but can be used with other interfaces as well, since the input has Schmitt trigger waveshaping. VDD (pin 20) This pin is the positive supply pin, and should always be the most positive point in the circuit. Internal circuitry connected to this pin is used to provide power on reset of the microprocessor, so an external reset signal is not required. Refer to the Electrical Characteristics section for further information. ISO K (pin 21) and ISO L (pin 22) These are the active high output signals which are used to drive the ISO 9141 and ISO 14230 buses to an active (dominant) level. Many new vehicles do not require the L Line - if yours does not, you can simply leave pin 22 open-circuited. CAN Tx (pin 23) and CAN Rx (pin 24) These are the two CAN interface signals that must be connected to a CAN transeiver IC for proper operation. If you are connecting to an existing CAN system, the integrity of the entire system might be jeopardized if a proper interface is not used. See the Example Applications section for more information. RS232 Rx LED (pin 25), RS232 Tx LED (pin 26), OBD Rx LED (pin 27) and OBD Tx LED (pin 28) These four output pins are normally high, and are driven to low levels when the ELM327 is transmitting or receiving data. Current capability is suitable for directly driving most LEDs through current limiting resistors, or interfacing to other logic for status reporting. If unused, these pins should be left opencircuited.
Ordering Information
These integrated circuits are 28 pin devices, available in either a 300 mil wide plastic (`skinny') DIP format or in a 300 mil SOIC surface mount type of package. To order, add the appropriate suffix to the part number: 300 mil 28 pin Plastic DIP..............................ELM327P 300 mil 28 pin SOIC....................................ELM327SM
ELM327DSC
Elm Electronics - Circuits for the Hobbyist www.elmelectronics.com
3 of 51
ELM327
Absolute Maximum Ratings
Storage Temperature....................... -65C to +150C Ambient Temperature with Power Applied....................................-40C to +85C Voltage on VDD with respect to VSS............ 0 to +7.5V Voltage on any other pin with respect to VSS........................... -0.3V to (VDD + 0.3V) Note: Stresses beyond those listed here will likely damage the device. These values are given as a design guideline only. The ability to operate to these levels is neither inferred nor recommended.
Electrical Characteristics
All values are for operation at 25C and a 5V supply, unless otherwise noted. For further information, refer to note 1 below.
Characteristic
Supply voltage, VDD VDD rate of rise Average supply current, IDD Input threshold voltage Schmitt trigger input thresholds rising falling Output low voltage Output high voltage Brown-out reset voltage A/D conversion time Notes:
Minimum
4.5 0.05
Typical
5.0
Maximum Units
5.5 V V/ms
Conditions
see note 2 see note 3 all except Schmitt inputs see note 4
9 1.0 2.9 1.0 1.5 0.3 4.6 4.07 4.2 7 4.59 1.3 4.0
mA V V V V V V msec
current (sink) = 10 mA current (source) = 10 mA
see note 5
1. This integrated circuit is produced with one of Microchip Technology Inc.'s PIC18F2x8x family of devices as the core embedded microcontroller. For further device specifications, and possibly clarification of those given, please refer to the appropriate Microchip documentation (available at http://www.microchip.com/). 2. This spec must be met in order to ensure that a correct power on reset occurs. It is quite easily achieved using most common types of supplies, but may be violated if one uses a slowly varying supply voltage, as may be obtained through direct connection to solar cells or some charge pump circuits. 3. Device only. Does not include any load currents. 4. Pins 1, 11, 12, 13, 15 and 18 (only) have internal Schmitt trigger waveshaping circuitry. All other inputs use standard CMOS circuitry. 5. The typical width of the Busy output pulse while the ELM327 interprets the command, measures the voltage, scales it and then transmits the result of a mid-range measurement, with the RS232 rate at 38400 baud.
ELM327DSC
Elm Electronics - Circuits for the Hobbyist www.elmelectronics.com
4 of 51
ELM327
Overview
The following describes how to use the ELM327 to obtain information from your vehicle. We begin by discussing just how to "talk" to the IC using a PC, then explain how to change options using `AT' commands, and finally we show how to use the ELM327 to obtain trouble codes (and reset them). For the more advanced experimenters, there are also sections on how to use some of the programmable features of this product as well. Using the ELM327 is not as daunting as it first seems. Many users will never need to issue an `AT' command, adjust timeouts, or change the headers. For most, all that is required is a PC or a PDA with a terminal program (such as HyperTerminal or ZTerm), and knowledge of one or two OBD commands, which we will provide in the following sections...
Communicating with the ELM327
The ELM327 expects to communicate with the host through an RS232 serial connection. Modern computers do not usually provide a physical connection such as this, but there are several ways in which a `virtual serial port' can be created. The most common devices are USB to RS232 adapters, but there are several others such as ethernet to RS232 devices, or Bluetooth to serial adapters. No matter how you physically connect to the ELM327, you will need a way to send and receive characters. To do this, the simplest method is to use one of the many `terminal' programs that are available (HyperTerminal, ZTerm, etc.), to allow typing the characters directly from your keyboard. To use a terminal program, you will need to make several settings. First, ensure that your software is set to use the proper `COM' port, and that you have chosen the proper data rate - this will be either 9600 baud (if pin 6=0V at power up), or 38400 baud (if PP 0C has not been changed). If you select the wrong "COM" port, you will not be able to send or receive any data. If you select the wrong data rate, the information that you send and receive will be all garbled, and unreadable by you or the ELM327. Don't forget to also set your connection for 8 data bits, no parity bits, and 1 stop bit, and to also set it for the proper "line end" mode. All of the responses from the ELM327 are terminated with a single carriage return character and, optionally, a linefeed character (depending on your settings). Properly connected and powered, the ELM327 will energize the four LED outputs in sequence (as a lamp test) and will then send the message: ELM327 v1.2 > In addition to identifying the version of this IC, receiving this string is a good way to confirm that the
ELM327DSC
computer connections and terminal software settings are correct (however, at this point no communications have taken place with the vehicle, so the state of that connection is still unknown). The `>' character that is shown on the second line is the ELM327's prompt character. It indicates that the device is in the idle state, ready to receive characters on the RS232 port. Characters sent from the computer can either be intended for the ELM327's internal use, or for reformatting and passing on to the vehicle. The ELM327 can quickly determine where the received characters are to be directed by analyzing the entire string once the complete message has been received. Commands for the ELM327's internal use will always begin with the characters `AT', while OBD commands for the vehicle are only allowed to contain the ASCII codes for hexadecimal digits (0 to 9 and A to F). Whether an `AT' type internal command or a hex string for the OBD bus, all messages to the ELM327 must be terminated with a carriage return character (hex `0D') before it will be acted upon. The one exception is when an incomplete string is sent and no carriage return appears. In this case, an internal timer will automatically abort the incomplete message after about 20 seconds, and the ELM327 will print a single question mark (`?') to show that the input was not understood (and was not acted upon). Messages that are not understood by the ELM327 (syntax errors) will always be signalled by a single question mark. These include incomplete messages, incorrect AT commands, or invalid hexadecimal digit strings, but are not an indication of whether or not the message was understood by the vehicle. One must keep in mind that the ELM327 is a protocol interpreter that makes no attempt to assess the OBD messages for validity - it only ensures that an even number of hex digits were received, combined into bytes, then sent out the OBD port, and it does not know if the
5 of 51
Elm Electronics - Circuits for the Hobbyist www.elmelectronics.com
ELM327
Communicating with the ELM327 (continued)
message sent to the vehicle was in error. While processing OBD commands, the ELM327 will continually monitor for an RTS input, or an RS232 input. Either one will interrupt the IC, quickly returning control to the user, and possibly aborting any initiation, etc. that was in progress. If you desire to interrupt the ELM327, that's fine, but for normal orderly data transfer, users should always wait for either the prompt character (`>' or hex 3E), or a low level on the Busy output before beginning to send the next command. Finally, it should be noted that the ELM327 is not case-sensitive, so `ATZ' is equivalent to `atz', and to `AtZ'. Also, it ignores space characters and all control characters (tab, linefeed, etc.) in the input, so they can be inserted anywhere to improve readability. Another feature is that sending only a single carriage return character will always repeat the last command (making it easier to request updates on dynamic data such as engine rpm).
AT Commands
Several parameters within the ELM327 can be adjusted in order to modify its behaviour. These do not normally have to be changed before attempting to talk to the vehicle, but occasionally the user may wish to customize these settings - for example by turning the character echo off, adjusting a timeout value, or changing the header bytes. In order to do this, internal `AT' commands must be issued. Those familiar with PC modems will immediately recognize AT commands as a standard way in which modems are internally configured. The ELM327 uses essentially the same method, always watching the data sent by the PC, looking for messages that begin with the character `A' followed by the character `T'. If found, the next characters will be interpreted as internal configuration or `AT' commands, and will be executed upon receipt of a terminating carriage return character. The ELM327 will usually reply with the characters `OK' on the successful completion of a command, so the user knows that it has been executed. Some of the following commands allow passing numbers as arguments in order to set the internal values. These will always be hexadecimal numbers which must generally be provided in pairs. The hexadecimal conversion chart in the OBD Commands section may prove useful if you wish to interpret the values. Also, one should be aware that for the on/off types of commands, the second character is the number 1 or 0, the universal terms for on and off. The following is a description of all of the AT commands that are recognized by the current version of the ELM327. Since there are many, a summary page is provided after this section.
AL
[ Allow Long messages ]
The standard OBDII protocols restrict the number of data bytes in a message to seven, which the ELM327 normally does as well (for both send and receive). If AL is selected, the ELM327 will allow long sends (eight data bytes) and long receives (unlimited in number). The default is AL off (and NL selected). AR [ Automatically set the Receive address ]
Responses from the vehicle will be acknowledged and displayed by the ELM327, if its internally stored receive address matches the address that the
ELM327DSC
message is being sent to. With the auto receive mode in effect, the value used for the receive address will be chosen based on the current header bytes, and will automatically be updated whenever the header bytes are changed. The value that is used for the receive address is determined based on the contents of the first header byte. If it shows that the message uses physical addressing, the third header byte of the header is used for the receive address, otherwise (for functional addressing) the second header byte, increased in value by 1, will be used. Auto Receive is turned on by default, and is not used by the J1939 formatting.
Elm Electronics - Circuits for the Hobbyist www.elmelectronics.com
6 of 51
ELM327
AT Commands (continued)
AT0, AT1 and AT2 [ Adaptive Timing control ] BI [ Bypass the Initialization sequence ]
When receiving responses from a vehicle, the ELM327 has traditionally waited the time set by the AT ST hh setting for a response. To ensure that the IC would work with a wide variety of vehicles, the default value was set to a conservative (slow) value. Although it was adjustable, many people did not have the equipment or experience to determine a better value. The new Adaptive Timing feature will automatically set the timeout value for you, based on the actual response times that your vehicle is responding in. As conditions such as bus loading, etc. change, the algorithm learns from them, and makes appropriate adjustments. Note that it always uses your AT ST hh setting as a maximum setting, however. With this new Adaptive Timing, sampling rates are often doubled or tripled from those typically experienced with prior versions. There are three adaptive timing settings that are available for use. By default, Adaptive Timing option 1 (AT1) is selected, and is the recommended setting. AT0 is used to disable Adaptive timing (usually used when experimenting), while AT2 is a more agressive version of AT1 (the effect is more noticeable for very slow connections - you may not see much difference with faster OBD systems). The J1939 protocol does not support Adaptive Timing - responses for J1939 use fixed timeouts as set in the standard. BD [ perform an OBD Buffer Dump ]
This command should be used with caution. It allows an OBD protocol to be made active without requiring any sort of initiation or handshaking to occur. The initiation process is normally used to validate the protocol, and without it, results may be difficult to predict. It should not be used for routine OBD use, and has only been provided to allow the construction of ECU simulators and training demonstrators. BRD hh [ try Baud Rate Divisor hh ]
All messages sent and received by the ELM327 are stored temporarily in a set of twelve memory storage locations called the OBD Buffer. Occasionally, it may be of use to view the contents of this buffer, perhaps to see why an initiation failed, to see the header bytes in the last message, or just to learn more of the structure of OBD messages. You can ask at any time for the contents of this buffer to be `dumped' (printed) - when you do, the ELM327 sends a length byte (representing the length of the message in the buffer) followed by the contents of all twelve OBD buffer locations. The length byte represents the actual number of bytes received, whether they fit into the OBD buffer or not. This may be useful when viewing long data streams (with AT AL), as the number accurately represents the number of bytes received, mod 256. Note that only the first twelve bytes received are stored in the buffer.
ELM327DSC
This command is used to change the RS232 baud rate divisor to the hex value provided by hh. The actual baud rate (in kbps) will be 4000 divided by this divisor. For example, a setting of 115.2kbps would require a divisor of 4000/115.2 or 35. In hexadecimal notation, 35 is written as 23, so the actual command that needs to be sent would be AT BRD 23. Since the ELM327 may be able to operate at much higher rates than some interfaces can support, the BRD command allows requested rates to be tested before they are committed to (with automatic fall-back to the previous baud rate if there are problems). In use, the command is sent to request a change in the baud rate, and the ELM327 responds with the familiar "OK". After that, an internal timer begins waiting, to ensure that the controlling computer has sufficient time to change their baud rate to the new rate. The ELM327 then sends the poweron message at the new baud rate, and begins waiting while the controlling computer assesses what has been received. If the AT I message was received without errors, the controlling computer sends a carriage return character, and if received by the ELM327, the rate will be retained. If the controlling computer sees errors (or worse, nothing), it provides no response, and switches back to the initial baud rate. If the ELM327 times out after receiving no response, or has received something that does not appear to be a carriage return character, it will revert back to the former baud rate. A more detailed discussion of this entire process is provided in the `Using Higher RS232 Baud Rates' section. Any new baud rate that is set in this manner is retained across calls to set defaults (AT D), and for warm starts (AT WS), but will not survive a hardware reset (a power off/on or a call to AT Z). If you are in the habit of calling AT Z in your code, we advise using AT WS instead.
7 of 51
Elm Electronics - Circuits for the Hobbyist www.elmelectronics.com
ELM327
AT Commands (continued)
BRT hh [ set Baud Rate Timeout to hh ] be inserted for you. Similarly, when sending a data request with formatting off, you must provide all of the required data bytes exactly as they are to be sent - the ELM327 will not perform any formatting for you other than to add some trailing 'padding' bytes to ensure that the required eight data bytes are sent. This allows operation in systems that do not use PCI bytes as ISO 15765-4 does. Note that turning the display of headers on (with AT H1) will override some of the CAF1 formatting of the received data frames, so that the received bytes will appear much like in the CAF0 mode (ie. as received). It is only the printing of the received data that will be affected when both CAF1 and H1 modes are enabled, though; when sending data, the PCI byte will still be created for you and padding bytes will still be added. Auto Formatting on (CAF1) is the default setting for the ELM327. CF hhh [ set the CAN ID Filter to hhh ]
This command allows the timeout used for the Baud Rate handshake (AT BRD) to be varied. The time delay is given by hh x 5.0 msec, where hh is a hexadecimal value. The default value for this setting is 0F, providing 75msec. Note that a value of 00 does not result in 0 msec - it provides the maximum time of 256 x 5.0 msec.
CAF0 and CAF1
[ CAN Auto Formatting off or on ]
These commands determine whether the ELM327 assists you with the formatting of the CAN data that is sent and received. With CAN Automatic Formatting enabled (CAF1), the IC will automatically generate formatting (PCI) bytes for you when sending, and will remove them when receiving. This means that you can continue to issue OBD requests (01 00, etc.) as usual, without regard to these extra bytes that the CAN diagnostics systems require. With formatting on, the trailing (unused) data bytes that are received in a frame will be removed as well, and only the relevant ones will be shown. Beginning with v1.2 of the ELM327, lines with invalid PCI bytes are now ignored, rather than showing them as `


▲Up To Search▲   

 
Price & Availability of ELM3271

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X